package com.ffz.springbootvuedemo.controller;

import com.ffz.springbootvuedemo.bean.Result;
import com.ffz.springbootvuedemo.util.ResultUtils;

/**
 * @description: 基类
 * @author: fengfazheng
 * @create: 2021-12-26 23:36
 **/
public class BaseController {
    public Result resultOk() {
        return ResultUtils.resultOk();
    }

    public <T extends Result> T resultOk(Object data) {
        return ResultUtils.resultOk(data);
    }

    public <T extends Result> T resultOk(Object data, String msg) {
        return ResultUtils.resultOk(data, msg);
    }

    public Result resultFail() {
        return ResultUtils.resultFail();
    }

    public Result resultFail(String msg) {
        return ResultUtils.resultFail(msg);
    }

    public Result resultFail(int code, String msg) {
        return ResultUtils.resultFail(code, msg);
    }
}
